import request from '@/utils/request'

// 分页查询历史持仓记录
export function getHistoricalPositionPage(query) {
  return request({
    url: '/historical-position/page',
    method: 'get',
    params: query
  })
}

// 上传历史持仓图片
export function uploadHistoricalPosition(formData) {
  return request({
    url: '/historical-position/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 删除历史持仓记录
export function deleteHistoricalPosition(id) {
  return request({
    url: `/historical-position/${id}`,
    method: 'delete'
  })
}

// 批量删除历史持仓记录
export function batchDeleteHistoricalPosition(ids) {
  return request({
    url: '/historical-position/batch',
    method: 'delete',
    data: ids
  })
}

// 获取单条历史持仓记录
export function getHistoricalPositionById(id) {
  return request({
    url: `/historical-position/${id}`,
    method: 'get'
  })
}